<template>
	<view class="mainpadding">
		<view class="margin_top blockbox flexbetween mainpadding" v-for="item in list.data" :key="item.id" @click="jumpDetail(item.hddata.id,item.hddata.user_id);">
			<image class="touxiang margin_right3" :src="item.user.avatar_text" mode=""></image>
			<view class="flexbetween" style="width: 80%;">
				<view class="">
					<view class="xiaohong titletext">{{item.user.nickname}}</view>
					<view class="margin_top1 flexleft">
						<!-- <view class="xiaobai strongtext">回复了</view>
						<view class="xiaohong strongtext">李华</view> -->
						<view class="xiaobai strongtext xiankuan">{{item.memo}}</view>
					</view>
					<view class="xiaohui strongtext margin_top1">{{item.createtime_text}}</view>
				</view>
				<image class="shilitu" :src="item.hddata.image_text" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")

	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			jumpDetail(id, listuser_id) {
				uni.navigateTo({
					url: "/pages_homepage/shipinxq?id=" + id + "&listuser_id=" + listuser_id
				})
				this.addviewnum(id)
			},
			addviewnum(id) {
				httpRequest.request('/api/videocl/addViewNum', 'GET', {
					id
				}).then(res => {})
			},
			init(isPage, page) {
				let _this = this
				httpRequest.request('/api/user/hdrecordIndex', 'GET', {
					page: page || 1,
					limit: 12,
					hd_type:2,
				}).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.shilitu {
		width: 114rpx;
		height: 114rpx;
		border-radius: 15rpx 15rpx 15rpx 15rpx;
	}

	.blockbox {
		background: #282536;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
	}

	.touxiang {
		width: 114rpx;
		height: 114rpx;
		border-radius: 50%;
	}
</style>